<div id="load_options_form">
	<h2>Load Option Set</h2>
	<div class="content">
		<div class="form300">
			<? if (!isset($fatalError)): ?>
				<?= Phpr_Form::openTag() ?>
					<? $this->formRender($obj) ?>

					<script type="text/javascript">
						$('load_options_form').addEvent('popupLoaded', function(){
							$('<?= $this->formGetUniquePrefix()?>Shop_OptionSet_existing_id').focus();
							
							$('load_options_form').bindKeys({'enter': function(){
								$('load_optset_btn').getForm().sendPhpr('onLoadOptionSet', {
									loadIndicator: {injectInElement: true},
									onSuccess: updateCustomAttributeList.pass('<?= $session_key ?>')
								}); 
							}})
						});
					</script>

					<?= backend_ajax_button('Load', 'onLoadOptionSet', array('id'=>'load_optset_btn'), "
						loadIndicator: {injectInElement: true},
						onSuccess: updateCustomAttributeList.pass('$session_key')
					") ?>
					<?= backend_button('Cancel', array('onclick'=>'return cancelPopup()')) ?>

					<div class="clear"></div>
					<input type="hidden" name="product_session_key" value="<?= h($session_key) ?>"/>
				</form>
			<? else: ?>
				<?= flash() ?>
				<?= backend_button('Cancel', array('onclick'=>'return cancelPopup()')) ?>
				<div class="clear"></div>
			<? endif ?>
		</div>
	</div>
</div>